<!DOCTYPE html>
<html>

<head>
  <style>
    a:link,
    a:visited {
      background-color: white;
      color: black;
      border: 2px solid green;
      padding: 10px 20px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
    }

    a:hover,
    a:active {
      background-color: green;
      color: white;
    }
  </style>
</head>

<body>
  <a href="javascript:alert('Are you OK?');">点我</a>
</body>

</html>